Skip to content

Conversation

@odersky
Copy link
Contributor

@odersky odersky commented Nov 7, 2015

No description provided.

@odersky odersky force-pushed the stdlib-definitions branch 3 times, most recently from c0b6351 to a384d83 Compare November 8, 2015 17:32
@odersky
Copy link
Contributor Author

odersky commented Nov 8, 2015

/rebuild

1 similar comment
@odersky
Copy link
Contributor Author

odersky commented Nov 8, 2015

/rebuild

@odersky odersky force-pushed the stdlib-definitions branch from 3407494 to 73ff369 Compare November 9, 2015 09:37
@odersky
Copy link
Contributor Author

odersky commented Nov 9, 2015

Rebased to master.

@odersky
Copy link
Contributor Author

odersky commented Nov 9, 2015

/rebuild

@odersky
Copy link
Contributor Author

odersky commented Nov 9, 2015

Current status: The stdlib slice in scala-collections-whitelist now compiles, except for #912 and #916.
#912 is a tailrec problem. I assigned this one to @DarkDimius. #916 is contentious whether the bug is on dotty's side or whether there's an undiagnosed problem in the library/ Waiting for input from @adriaanm or @retronym on this one.

@DarkDimius
Copy link
Contributor

@odersky is this PR ready for review?

@DarkDimius
Copy link
Contributor

OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000006d9600000, 2555379712, 0) failed; error='Cannot allocate memory' (errno=12)

/rebuild

@odersky
Copy link
Contributor Author

odersky commented Nov 9, 2015

/rebuild

1 similar comment
@odersky
Copy link
Contributor Author

odersky commented Nov 9, 2015

/rebuild

@odersky
Copy link
Contributor Author

odersky commented Nov 9, 2015

@DarkDimius Ready for review now.

Symbols are not stable between runs, so if some symbol referred
to from Definitions gets recompiled, there are then two Symbols
that are both visible, one referenced from Definitions, the other
the one that got compiled.

Thos led to a crash when e.g. compiling scala.Short, because the
newly compiled symbol was not recognized as a primitive value
class.

The present commit tries to make systematic changes without regard
to simplicity or aesthetics. This will be polished in future commits.
// ### comments signal areas that need further attention.
TypeRefs can have several representations for logically the
same type, so they don't make good keys.
Also, delete unused `uncheckedStableClassRef` entry.
Can't be a lazy val, because one of the symbols it tests
(`newRefArray`) can be recomputed.
Remve versions in Symbols, always go through version in
Denotations. Avoids having two equivalent ways to do the same thing.
Was a lazy val, but this is not stable under recompilation.
Maps should not have TypeRefs as keys, yet symbols are not stable
for recompilation. Solution: Construct these maps over symbols but
move them to CapturedVars#Transform where they will be re-built
on each run.
Remove unneeded maps and make the ones that are needed
private. Reason: Maps indexed with TypeNames are prone
to misuse; should be accessed only with names of known
primitive classes.
Contains tests on thsoe sets would be flakey anyway.
1) Have symbol sets cached per run
2) Use methods Denotation#isPrimitiveValueClass, Denotation#isNumericValueClass
instead of calling contains directly on symbol sets.
TypeRef becomes Type, thus removing duplicates. Where
...Type was used in an extraction (e.g. ArrayType(...),
FunctionType(...)), we now use ...Of.
Since we now have two forms of (almost) everything in Definitions,
might as well profit from it.
Again it dies without an exception trace. Is partest eating error output?
Now also provides compilation unit.
Track starts and ends of completions using indentation.
Forces a bit less, and could be more efficient.
Did not seem to make a difference with current
CyclicReferences though, except that cyclic
error happened a bit later in the sequence.
Set info early in order to avoid cyclic reference errors.
Errors were observed when compiling

    scala/Predef.scala scala/package.scala scala/collection/GenSeqLike.scala
Was stdout, but this gets mixed up with the exception printing on stderr.
@odersky odersky force-pushed the stdlib-definitions branch from 523f4d4 to b112b2b Compare November 9, 2015 14:59
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could defn.ProductNType(n) be used here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because it would load the class. That's what caused the datarace after all.

@DarkDimius
Copy link
Contributor

/rebuild

1) Check that searched scope is consistent
2) Do a linear search for symbol with name, and report
   if something was found that way.
@odersky
Copy link
Contributor Author

odersky commented Nov 9, 2015

/rebuild

2 similar comments
@odersky
Copy link
Contributor Author

odersky commented Nov 9, 2015

/rebuild

@odersky
Copy link
Contributor Author

odersky commented Nov 9, 2015

/rebuild

DarkDimius added a commit that referenced this pull request Nov 10, 2015
Make Definitions survive recompilation of core definitions.
@DarkDimius DarkDimius merged commit 7cfd3ca into scala:master Nov 10, 2015
@allanrenucci allanrenucci deleted the stdlib-definitions branch December 14, 2017 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants